package ch00.a9;

/**
 * @description: 类描述
 * @author: Fesine
 * @createTime:2016/7/12 23:51
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2016/7/12 23:51
 */
public abstract class Animal {
    protected String name;

    public Animal(String name) {
        this.name = name;
    }

    public Animal() {
        this.name = "无名";
    }

    protected int shoutNum = 3;

    public int getShoutNum() {
        return shoutNum;
    }

    public void setShoutNum(int shoutNum) {
        this.shoutNum = shoutNum;
    }

    public  String shout(){
        String result = "";
        for (int i = 0; i < shoutNum; i++) {

            result += getShoutSound();
        }
        return "我的名字叫:" + name + " " + result;
    }

    protected abstract String getShoutSound();
}
